package com.ayf.payment.game.api.service;

import com.ayf.payment.game.api.dto.ReissueAllTaskDTO;
import com.ayf.payment.game.api.dto.ReissueRecordDTO;
import com.ayf.payment.game.api.dto.ReissueRecordVO;
import com.ayf.payment.game.api.dto.criteria.ReissueRecordCriteria;
import com.ayf.payment.game.api.dto.criteria.ReissueRecordSelectCriteria;
import com.ayf.payment.game.api.dto.getaway.CheckOrderIDGateWayDTO;
import com.ayf.payment.game.api.dto.getaway.GameRechargeGetWayDTO;
import com.ayf.payment.game.api.dto.getaway.ReplacementGetWayDTO;
import com.ayf.payment.game.api.dto.platform.MerchantReissueRecordDTO;
import com.ayf.payment.game.api.dto.platform.criteria.MerchantReissueRecordCriteria;
import com.ayf.payment.game.api.entity.Partition;
import com.ayf.payment.game.api.entity.ReissueAllTask;
import com.ayf.payment.game.api.entity.ReissueRecord;
import com.ayf.payment.game.api.utils.CommonResult;
import com.github.pagehelper.PageInfo;
import org.apache.poi.ss.formula.functions.T;

import java.util.List;
import java.util.Map;

public interface ReissueRecordService {

 public List<ReissueRecordDTO> selectByPage(ReissueRecordSelectCriteria selectCriteria);

 /**
  * 查询补发总金额
  *
  * @param selectCriteria
  * @return
  */
 ReissueRecordVO selectTotalAmountByPage(ReissueRecordSelectCriteria selectCriteria);

 /**
  * 平台商户补发
  * @param selectCriteria
  * @return
  */
 public List<MerchantReissueRecordDTO> selectMerchantReissueRecordByPage(MerchantReissueRecordCriteria selectCriteria);

 /**
  * 保存整区补发
  * @param t
  */
 Map saveAuto(ReissueAllTaskDTO t);

 /**
  * 整区补发
  * @param reissueAllTask
  */
 Map reissueAll(ReissueAllTask reissueAllTask,int isAutoReissue);

 public void update(ReissueRecord t);

 public void del(ReissueRecord t);

 public void delByIds(String[] Ids);

 public ReissueRecord find(Integer merchantId, String id);

 /**
  * 分页进行订单整区补发
  * @param t
  * @param pageNum
  * @param pageSize
  * @return
  */
 List<GameRechargeGetWayDTO> reissue(ReissueAllTask t, Integer pageNum, Integer pageSize, boolean typeOne, boolean typeTwo, boolean typeThree,Partition partition,int isAutoReissue);

 /**
  * 整区补发到网关
  * @param reissueAllTask
  * @return
  */
  void rechargeAllGetWay(List<GameRechargeGetWayDTO> rechargelist,Partition partition , ReissueAllTask reissueAllTask);


 /**
  * 网关补发
  * @param merchantId
  * @param id
  * @return
  */
 public CommonResult<T> rechargeGetWay(Integer merchantId, String id);

 /**
  * 手动充值
  *
  * @param manualCriteria
  * @return
  */
 String  manualTopUp(ReissueRecordCriteria manualCriteria);

 /**
  * 分页查询所有手动充值的记录
  *
  * @param selectCriteria
  * @return
  */
 PageInfo selectAllManual(ReissueRecordSelectCriteria selectCriteria);

 //后补整区补发
 boolean sendGateWayWholeReplacement(ReplacementGetWayDTO dto);
 //后补手动充值
 boolean sendGateWayManualReplacement(ReplacementGetWayDTO dto);

 //检查Socket TimeOut订单-按订单单号
 boolean sendGateWayCheckOrder(CheckOrderIDGateWayDTO dto);

 /**
  * 修改订单状态
  * @param serialNumbers
  * @param scriptStatus
  */
 void updateManualReplacement(String serialNumbers, int scriptStatus);

 /**
  * 按id组 更新脚本状态
  * @param ratIds
  * @param scriptStatus
  */
 void updateReissueAllTasks(String ratIds, int scriptStatus);

 GameRechargeGetWayDTO manualGiveDetail(ReissueRecordCriteria manualCriteria);
}




